<template>
	<view>
		<uni-load-more status="loading" v-if="lists.length === 0&&!articleShow"></uni-load-more>
		<list-card v-for="item in lists" :key="item.id" :item="item"></list-card>
		<view class="no-data" v-if="lists.length === 0 && articleShow">
			没有更多数据了
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				lists: [],
				articleShow: false
			}
		},
		onLoad() {
			this.getMyArticle();
		},
		methods: {
			getMyArticle() {
				this.$api.get_my_article().then(res => {
					console.log(res);
					const {
						data
					} = res;
					this.articleShow = true;
					this.lists = data;
				})
			}
		}
	}
</script>

<style lang="scss">
	.no-data {
		width: 100%;
		height: 300rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		font-size: 14px;
	}
</style>
